package com.jrfid.smartcabinet.demo.ui.home

import android.app.Application
import android.view.View
import androidx.lifecycle.ViewModel
import androidx.navigation.NavController
import com.jrfid.smartcabinet.demo.R
import com.jrfid.smartcabinet.demo.base.BaseViewModel
import com.jrfid.smartcabinet.demo.ui.take_or_add.TakeOrAddGoodsFragmentArgs

class HomeViewModel(application: Application, navController: NavController) : BaseViewModel(application, navController) {

    fun onClickMenuBtn(view: View, type: Int) {
        when (type) {
            0 -> {
                navController.navigate(R.id.takeOrAddGoodsFragment, TakeOrAddGoodsFragmentArgs(true).toBundle())
            }
            1 -> {
                navController.navigate(R.id.takeOrAddGoodsFragment, TakeOrAddGoodsFragmentArgs(false).toBundle())
            }
            2 -> {
                navController.navigate(R.id.inventoryFragment)
            }
        }
    }

}